1. Field of the Invention
The present invention relates to a numerical control device controlling a machine tool and specifically relates to a numerical control device having a function of simultaneously executing a plurality of commands using data in table format.
2. Description of the Related Art
Japanese Patent Laid-Open No. 59-177604 and Japanese Patent Laid-Open No. 2003-303005 disclose a numerical control device having a path table operation function for which data in table format (path table) in which positions of axes or auxiliary functions are set with time, a position of an axis or a position of a spindle assumed as a reference is stored in a memory or a storage device connected thereto via a network, for driving the respective axes while sequentially read out the data in table format (path table). A tool can thereby flexibly operate without depending on a machining program, this allowing machining time to be reduced and machining to be performed with higher precision.
However, in operation based on the data in table format, commands which are sequentially read out are executed one by one within each piece of data in table format for controlling the axes, the spindle or the auxiliary functions. Hence, two or more commands in one piece of data in table format cannot be simultaneously executed. After the command that is previously read out reaches a reference value described in the data in table format, is executed, and is completed with its execution, the next command is read out. In the case where the command already exceeds the reference value at which the next command is to be executed and which is described in the data in table format by the execution of the command that is previously read out, an alarm is issued to stop the operation. Therefore, it is necessary to calculate operation time to complete the execution of the command that is previously read out in advance, and to describe the reference value at which the next command is executed in the data in table format. Due to this, to create the data in table format is made complex. Moreover, as to a command the operation time of which is indefinite, the reference value, at which the next command is executed and for which margin time is added to the maximum operation time, is described in the data in table format. This causes the cycle time to be longer.
Changing a control, mode of a spindle S on the basis of the data in table format is exemplarily described. In the conventional operation based on the data in table format, upon a command of changing the control mode of the spindle, a control mode changing command of the spindle is read out after completion of the execution of the previous command, and it is determined whether the command reaches the reference value described in the data in table format. When the command reaches the reference value described in the data in table format, the change of the control mode starts and the read out and the execution of the next command are awaited until the control mode is completed. Therefore, the operation time required for changing the control mode should be secured in advance to describe the reference value at which the next command is executed in the data in table format.
In data in table format <S1> on the spindle S illustrated in FIG. 1, L designates an address indicating the reference value (real time; in msec units) which is described in the data in table format and at which the command is executed, S2500 designates a spindle rotation speed command for setting the rotation speed of the spindle to 2500 (rpm), G96 designates a control mode changing command from a speed control mode to a contour control mode, and T0101 designates a sub-table calling command for calling a sub-table with table number 0101.
Supposing that the time required for changing the control mode is 1000 msec, margin time of 500 msec is added thereto. From the reference value (L6500) at which changing the control mode (G96) is commanded, the time interval of 1500 msec is secured to make the next command (T0101).
FIG. 2 shows a relation between the operation time and the margin time which are required for changing the control mode from the speed control mode to the contour control mode. At L2200, the spindle rotation speed command (S2500) is executed. Determination as to whether the command reaches the reference value is performed, and upon reaching 1.6500, the control mode changing command (G96) is executed to start changing the control mode. During the change of the control mode, the read out of the next command is awaited. Upon reaching L7500, changing the control mode is completed. Then, the sub-table calling command (T0101) is read out. Determination as to whether the command reaches the reference value is performed, and upon reaching L8000, the sub-table calling command (T0101) is executed.
Herein, as illustrated in FIG. 3, if the sub-table calling command for calling the sub-table with table number 0101 is commanded at the reference value L7000, the read out is to be performed at the reference value L7500 at which changing the control mode is completed. However, as illustrated in FIG. 4, since the command already exceeds the reference value which is described in the data in table format and at which the sub-table calling command is executed, it is necessary to stop the operation.
Due to this, in changing the control mode, the operation time required for changing the control mode should be obtained as a measured value or on the basis of an equation, and the margin time for correcting the operation time which fluctuates depending on the execution circumstances should be added thereto to describe the reference value at which the next command is executed in the data in table format. The above-mentioned problem is not limited to changing the control mode but the above-mentioned problem occurs to the execution of a command which requires operation time using the data in table format for controlling the axes, the spindle or the auxiliary functions.